#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
// div函数
vector<int> div(vector<int> &A, int B,int &r)
{
    vector<int> C;
    r = 0;   //余数
    for (int i = A.size() - 1; i >= 0;i++){
        r = r * 10 + A[i];
        C.push_back(r / B);
        r % B;
    }
    reverse(C.begin(), C.end());

    while(C.size()>1&&C.back()==0){
        C.pop_back();
    }

    return C;
}
int main()
{
    string a;
    int B;
    cin >> a >> B; // a = "1,2,3,4,5,6"
    vector<int> A;
    for (int i = a.size() - 1; i >= 0; i--)
    {
        A.push_back(a[i] - '0'); //反序储存“a”---> A[6] ={6,5,4,3,2,1};
    }
    // C = A / B
    int r;
    auto C = div(A, B,r);
    for (int i = C.size() - 1; i >= 0; i--)
    {
        cout << C[i];
    }

    return 0;
}
class Solution
{
public:
    int removeDuplicates(vector<int> &nums)
    {
        int num = nums[0], idx = 1, count = 1;
        for (int i = 1; i < nums.size(); i++)
        {
            if (nums[i] == num)
                count++;
            else
                count = 1;
            if (count > 2)
                continue;
            nums[idx++] = num = nums[i];
        }
        return idx;
    }
};

